<?php
/**
 * The Header for our theme.
 *
 * Displays all of the <head> section and everything up till <div id="main">
 *
 * @package WordPress
 * @subpackage Master Theme
 */
?>

<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
	
    <!-- DOC INFO / WINDOW TITLE -->
        <meta charset="<?php bloginfo( 'charset' ); ?>" />
        <link rel="profile" href="http://gmpg.org/xfn/11" />
        <title>
            <?php /* Print the <title> tag based on what is being viewed. */
                global $page, $paged;
                wp_title( '|', true, 'right' );
                // Add the blog name.
                bloginfo( 'name' );
                // Add the blog description for the home/front page.
                $site_description = get_bloginfo( 'description', 'display' );
                if ( $site_description && ( is_home() || is_front_page() ) )
                    echo " | $site_description";
            ?>
        </title>
    
    <!-- THEME STYLESHEETS -->
        <link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" />
        <link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'template_directory' ); ?>/master.css" />
        <link href='http://fonts.googleapis.com/css?family=Archivo+Narrow:400,400italic,700,700italic' rel='stylesheet' type='text/css'>

    <!-- QUEUE WORDPRESS SCRIPTS -->
		<?php
            /* 
             * DO NOT DELETE THIS, IMPORTANT HOOK...
             */
            wp_head();
        ?>
    
    <!-- QUEUE CONDITTIONAL THEME SCIPTS / STYLESHEETS ( after wp_head() is called our dependants) -->
		<?php if ( is_front_page() ) { ?>
            <!-- CAROUSEL FOR HOMEPAGE    - jQuery queued from functions.php -->
            <link rel="Stylesheet" type="text/css" href="<?php bloginfo( 'template_directory' ); ?>/carousel.css" />
            <script type="text/javascript">
                jQuery(document).ready(function($) {
                    // Queue the carousel
                    $('.carousel').carousel({directionNav:false, buttonNav:'bullets', carouselWidth:435, carouselHeight:291, slidesPerScroll:1, top:0, hMargin:0.5, frontWidth:425, frontHeight: 241, description:true, descriptionContainer:'.description', speed:800, pauseOnHover:true });
                });
            </script>
        <?php } elseif ( is_page('submit-documents') || is_page('manage-listings') ) { ?>
            <!-- jTip Tool Tips    - jQuery queued from functions.php -->
            <link rel="Stylesheet" type="text/css" href="<?php bloginfo( 'template_directory' ); ?>/global.css" /> 
        <?php } ?>
    
    <!-- BROWSER CONDITIONAL CSS FIXES -->
        <!--[if gte IE 8]>
            <style type="text/css">
                #listingDash th {
                    text-align: left;
                }
                th#reqDocs {
                    width: 100px !important;
                }
            </style>
        <![endif]-->
        <style type="text/css">
            @-moz-document url-prefix()
            {
                #main {
                    margin: -5px auto 0px auto !important;
                }
                #header {
                    position: relative;
                    top: 5px;
                }
                .page-title {
                    padding-top: 4px;
                }
                .post_count {
                    position: relative;
                    top: -1px;
                }
            }
        </style>

</head>

<body <?php body_class(); ?>>

	<!-- PAGE HEADER -->
        <div id="header_wrapper">
            <div id="header">
                
                <!-- LOGO - CONDITION LINKING -->
					<?php
                    if ( is_user_logged_in() && !is_guest() ) {
                        ?><h1 id="logo"><a href="<?php echo site_url('login'); ?>">[trudocs]</a></h1><?php
                    } else {
                        ?><h1 id="logo"><a href="<?php echo site_url(); ?>">[trudocs]</a></h1><?php
					}
					?>
                    <span id="tagLine">Short Sale Assistants</span>
                
                <!-- TOP NAVIGATION MENU - FLOATED RIGHT, SO LIST MENU ITEMS BACKWARDS -->
                    <div id="menu_wrap">
                    
                        <!-- USER NAV AVATAR / CUSTOM LOGOUT LINK -->
                            <div class="menu-header">
                                <ul id="menu-top-menu" class="menu">
                                    <?php if ( is_user_logged_in() && !is_guest() ) { ?>
                                        <li id="menu-item-99996" class="menu-item menuAvatar"><a href="<?php echo bp_loggedin_user_domain(); ?>"><?php bp_loggedin_user_avatar( array( 'width'  => '40', 'height' => '40' ) ); ?></a></li>
                                        <li id="menu-item-99997" class="menu-item"><?php wp_loginout( 'login', true ); ?></li>
                                    <?php } ?>
                                </ul>
                            </div>
                        
						<!-- SELCT MENU BASED ON USER ROLE -->
                            <?php if ( is_user_logged_in() ) {
                                if ( !is_guest() ) { //IF IS A ACCESSKEY USER
                                    wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'GUEST' ) );
                                } elseif ( is_ap() ) {
                                    wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'AP' ) );
                                } elseif ( is_ssa() ) {
                                    wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'SSA' ) );
                                } elseif ( is_angel() ) {
                                    wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'ANGEL' ) );
                                } elseif ( is_god() ) {
                                    wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'GOD' ) );
                                }
                            } else {
                                wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'LOGGEDOUT' ) );
                            } ?>
                        
                    </div><!-- END: TOP NAVIGATION MENU -->
                
            </div>
        </div><!-- END: PAGE HEADER -->
        
	<!-- CONTENT WRAPPER -->
        <div id="main_wrapper">
            <div id="main">